package com.towin.org.esdemo.es.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.apache.ibatis.type.JdbcType;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Setting;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 文档实体类
 *
 * @Document 注解用于标识这是一个 Elasticsearch 文档
 * @Setting 注解用于指定索引设置文件
 */
@Data
@Document(indexName = "system-help")
@Setting(settingPath = "es-settings.json")
public class SystemHelpCenterDTO {

    @Id
    private Integer id;


    // 标题
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    private String title;


    // 父级id
    @Field(type = FieldType.Integer)
    private Integer parentId;

    // 父级名称
    @Field(type = FieldType.Text)
    private String parentName;

    // 顶级id
    @Field(type = FieldType.Integer)
    private Integer topId;

    // 顶级名称
    @Field(type = FieldType.Text)
    private String topName;

    // 介绍
    @Field(type = FieldType.Text)
    private String Introduction;

    // 排序
    @Field(type = FieldType.Integer)
    private Integer sort;

    // 内容
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_smart")
    private String content;


    // 类型
    @Field(type = FieldType.Integer)
    private Integer type;


    /**
     * 创建时间
     */
    @Field(type = FieldType.Date, format = {}, pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;


    /**
     * 最后更新时间
     */
    @Field(type = FieldType.Date, format = {}, pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;



}
